package com.teacher.mobile.controller;


import com.teacher.common.CommonResult;
import com.teacher.pojo.dto.PageDto;
import com.teacher.security.entity.annotation.WhiteApi;
import com.teacher.service.ISchoolService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jiangzhuohang
 * @since 2024-03-14
 */
@RestController
@RequestMapping("/school")
@Api(tags = "学校列表")
public class SchoolController {

    @Autowired
    private ISchoolService schoolService;

    @WhiteApi
    @ApiOperation("根据名称搜索学校 ")
    @GetMapping("/getSchoolByName")
//    @ApiImplicitParam(name="status",value = "0禁用的 1启用的")
    public CommonResult getSchoolByName(String name){
        return schoolService.getSchoolByName(name);
    }

    @WhiteApi
    @ApiOperation("学校列表分页 ")
    @GetMapping("/getSchoolListPage")
//    @ApiImplicitParam(name="status",value = "0禁用的 1启用的")
    public CommonResult getSchoolListPage(PageDto pageDto){
        return schoolService.getSchoolListPage(pageDto);
    }
}

